package com.gragra.data;
import com.gragra.structures.Structure;
import com.gragra.structures.StructureGenerator;
/**
 * An interface for a group of structures. All this does is allow for easy access
 * to the included data and handle the addition of new data.
 * @author Christoph Teichmann
 * @version 0.1
 */
public interface Corpus<Type extends Structure> extends Iterable<Type>
{
	/**
	 * adds a single structure to the given data.
	 *
	 * @param s
	 */
	void addData(Type s);
	/**
	 * Adds new data entries by iterating over the strings in s and storing the structures produces by giving them to the structure generator.
	 * @param StructureGenerator
	 * @param s
	 */
	void addData(StructureGenerator<Type> StructureGenerator,
			Iterable<String> s);

	/**
	 * returns the size of the corpus.
	 * @return
	 */
	int size();

	/**
	 * adds a single data entry generated by giving the string to the StructureGenerator
	 * @param StructureGenerator
	 * @param string
	 */
	void addData(StructureGenerator<Type> StructureGenerator, String string);

	/**
	 * Adds all the Structures returned by the Iterator of the given Iterable
	 * @param s
	 */
	void addData(Iterable<Type> s);
	/**
	 * returns the i-th Structure in the corpus
	 * @param i
	 * @return
	 */
	Type getEntry(int i);
}